<!--
 * @Descripttion: 连接
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-09-13 16:20:51
 * @LastEditors: GW
 * @LastEditTime: 2021-10-13 10:50:04
-->
<template>
    <section class="show-wrapper">
        <template v-if="data.title">
            <div class="text-box">
                <a :href="data.text">{{data.title}}</a>
            </div>
        </template>
        <template v-else>
            <div class="text-box">
                点击编辑连接
            </div>
        </template>

    </section>
</template>

<script>
export default {
    name: 'Link',
    props: {
        data: {
            type: Object,
            default: {}
        }
    },
    mounted () {
        //组件默认数据
        let { data } = this;
        let defaultData = {
            title: data.title ? data.title : '点击编辑连接',
            onEdit:false,
        }
        this.data = Object.assign(data, defaultData);
    }
}
</script>

<style lang="less" scoped>
    .show-wrapper {
        padding:6px 12px;
        .text-box {
            text-align: center;
            letter-spacing: 1px;
            color: #007bff;
        }
    }
</style>